package com.example.handheld4_gsignal_app.ui.fragments;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.example.handheld4_gsignal_app.R;

/**
 * 简化版历史记录Fragment - 用于测试崩溃问题
 */
public class HistoryFragmentSimple extends Fragment {

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        try {
            android.util.Log.d("HistoryFragmentSimple", "onCreateView called");
            
            View view = inflater.inflate(R.layout.fragment_history_simple, container, false);
            
            TextView textView = view.findViewById(R.id.test_text);
            if (textView != null) {
                textView.setText("历史页面测试 - 如果看到这个文本，说明Fragment加载成功！");
                android.util.Log.d("HistoryFragmentSimple", "TextView found and set");
            } else {
                android.util.Log.e("HistoryFragmentSimple", "TextView not found");
            }
            
            return view;
        } catch (Exception e) {
            android.util.Log.e("HistoryFragmentSimple", "Error in onCreateView: " + e.getMessage(), e);
            throw e;
        }
    }
}